const { defineConfig } = require('@vue/cli-service')
const { AntDesignVueResolver } = require('unplugin-vue-components/resolvers')
const AutoImportVueModules = require('unplugin-auto-import/webpack')
module.exports = defineConfig({
  transpileDependencies: true,
  // lintOnSave:false,
  configureWebpack: {
    plugins: [
      // 自动引入vue、vue-router模块
      AutoImportVueModules({
        eslintrc: {
          enabled: true, // <-- this
          filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
          globalsPropValue: true
        },
        imports: [
          'vue',
          'pinia',
          //默认导出
          {
            axios: [['default', 'axios']]
          }
        ]
      }),
      // 自动导入antd组件及图标组件
      require('unplugin-vue-components/webpack')({
        resolvers: [
          AntDesignVueResolver({
            // importStyle: "less", // 配置自动引入less样式
            importStyle: 'css', // 配置自动引入css样式
            // importLess: true,  // 配置自动引入less样式
            resolveIcons: true // 引入antd-vue图标
          })
        ]
      })
    ]
  }
})
